<template>
	<view>
		<cu-custom  bgColor="bg-black-two"  :isBack="true">
			<block slot="content">帮助中心</block>
		</cu-custom>
		<view class="my-bg">
			<view @click="show(1)" class="flex justify-between my-title-bg">
				<view>开全自动前检查规范操作</view>
				<view>
					<text class="lg my-title-icon cuIcon-right"></text>
				</view>
			</view>
			<view @click="show(2)" class="flex justify-between my-title-bg" style="border: unset;">
				<view>更换产品开始生产的规范操作</view>
				<view>
					<text class="lg my-title-icon cuIcon-right"></text>
				</view>
			</view>
		</view>
		
		<view class="cu-modal" :class="modalNameVideo=='video'?'show':''" >
			<view class="cu-dialog" style="border-radius: 13px;background-color:unset">
				<view class="margin-bottom-sm">
					<video id="myvideo" :src="videoSrc" autoplay controls style="height: 600px;width: 360px;"></video>
				</view>
				<view class="action" @tap="hideModalVideo">
					<text class="cuIcon-roundclosefill text-blue" style="color: #847d7d;font-size: 30px;"></text>
				</view>
			</view>
		</view>
		
	</view>
</template>

<script>
	//post API
	import {requestPost} from '@/common/util.js'
	var _self;
	export default{
		data(){
			return{
				userName:'111',
				yue:0,//当前余额
				jifen:0,//当前积分
				modalNameVideo:'',
				videoSrc:''
			}
		},
		onShow() {
			_self = this;
			//获取当前登录用户名称
			this.userName =  uni.getStorageSync("userInfo").userName;
			this.videoContext = uni.createVideoContext('myvideo',this);
		},
		methods:{
			
			//跳转页面
			show(e){
				this.modalNameVideo = 'video';
				
				console.log(e);
				switch (e){
					case 1:
						this.videoSrc="https://vkceyugu.cdn.bspapp.com/VKCEYUGU-b9edaef5-4463-4bd3-a03d-539553170d62/200766b7-1389-4732-b8fe-66acd4c484a5.mp4"
						break;
					case 2:
						this.videoSrc="https://vkceyugu.cdn.bspapp.com/VKCEYUGU-b9edaef5-4463-4bd3-a03d-539553170d62/f83269ed-a159-4038-976e-c0940f7bcdbc.mp4"
						break;
				}
				console.log(this.videoSrc);
				// if(e == 1){
					
				// }
				// if(e == 2){
					
				// }
			},
			hideModalVideo(){
				this.videoContext.stop();
				this.modalNameVideo = null
			},
			clearModule(){
				let paramsArray = {};
				requestPost('clearModule',paramsArray,function(res){
					if (res.data.status !== "false") {
						uni.showToast({
							title:'清除模块订单成功',
							icon:'success'
						})
					}
				});
			}
		}
		
	}
</script>

<style>

</style>